import MaxHeap from './maxheap'

class PriorityQueue {
  constructor () {
    this.maxHeap = new MaxHeap()
  }

  size () {
    return this.maxHeap.size()
  }

  isEmpty () {
    return this.maxHeap.isEmpty()
  }

  peek () {
    return this.maxHeap.peek()
  }

  enqueue (element) {
    this.maxHeap.add(element)
  }

  dequeue () {
    return this.maxHeap.extractMax()
  }
}

export default PriorityQueue
